package mvp.com.bbc.newrelyframes.mvp.ui;

import android.graphics.Color;

import com.hjm.bottomtabbar.BottomTabBar;

import butterknife.BindView;
import mvp.com.bbc.newrelyframes.R;
import mvp.com.bbc.newrelyframes.base.BaseAcivity;
import mvp.com.bbc.newrelyframes.mvp.fragment.HomeFragment;
import mvp.com.bbc.newrelyframes.mvp.fragment.MallFragment;
import mvp.com.bbc.newrelyframes.mvp.fragment.MyFragment;
import mvp.com.bbc.newrelyframes.mvp.fragment.NewsFragment;

/**
 * Created by ${cbf} on 2017/12/5.
 */

public class StartActivity extends BaseAcivity {
    @BindView(R.id.bottomtabbar)
    BottomTabBar bottomtabbar;

    @Override
    protected int baseLayout() {
        return R.layout.activity_start;
    }

    @Override
    protected void iniView() {

    }

    @Override
    protected void initData() {
        //不能滑动屏幕关闭界面
        setSwipeBackEnable(false);
        bottomtabbar.init(getSupportFragmentManager())
                .setImgSize(50, 50)
                .setFontSize(12)
                .setTabPadding(4, 6, 10)
                .setChangeColor(Color.RED, Color.DKGRAY)
                .addTabItem("首页", R.mipmap.ic_launcher, HomeFragment.class)
                .addTabItem("新闻", R.mipmap.ic_launcher, NewsFragment.class)
                .addTabItem("商城", R.mipmap.ic_launcher, MallFragment.class)
                .addTabItem("个人中心", R.mipmap.ic_launcher, MyFragment.class)
                .setDividerColor(Color.BLACK)
                .isShowDivider(true)
                .setOnTabChangeListener(new BottomTabBar.OnTabChangeListener() {
                    @Override
                    public void onTabChange(int position, String name) {
                    }
                });

    }

}
